Skip to content

Conversation

@sormuras
Copy link
Member

@sormuras sormuras commented Oct 9, 2025

Please review this PR introducing the org.junit.start module.

Closes #4982

New "Source Launcher" section in "Running Tests" of the User Guide

image

I hereby agree to the terms of the JUnit Contributor License Agreement.


Definition of Done

@sormuras sormuras changed the title Introduce org.junit.onramp module Introduce org.junit.start module Oct 17, 2025
@sormuras sormuras marked this pull request as ready for review November 4, 2025 11:29
Comment on lines +57 to +65
[source,java,indent=0]
----
import module org.junit.start;
void main() { JUnit.run(); }
@Test
void test() { Assertions.assertEquals(2, 1 + 1); }
----
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We don't usually include code snippets in the release notes. Can we link to the User Guide instead?

==== New Features and Improvements

* Introduce new module `org.junit.start` for writing and running tests. It simplifies
usages of JUnit in compact source files together with a single module import statement:
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
usages of JUnit in compact source files together with a single module import statement:
using JUnit in compact source files together with a single module import statement:

Comment on lines +848 to +857
import module org.junit.start;

void main() {
JUnit.run();
}

@Test
void stringLength() {
Assertions.assertEquals(11, "Hello JUnit".length());
}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Would it be possible to replace this snippet with an include of a source file from src/test/java? That way it would get compiled.

public static final String GRADLE_KOTLIN_EXTENSIONS = "gradle-kotlin-extensions";
public static final String GRADLE_MISSING_ENGINE = "gradle-missing-engine";
public static final String JAR_DESCRIBE_MODULE = "jar-describe-module";
public static final String JUNIT_start = "junit-start";
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
public static final String JUNIT_start = "junit-start";
public static final String JUNIT_START = "junit-start";

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Introduce org.junit.start module

4 participants